# -*- coding:utf-8 -*-

#def fact(x):
#    if x == 1:
#        return x
#    else:
#        return x * fact(x-1)

def fact(n):
    return fact_inter(n,1)

def fact_inter(num,product):
    if num == 1:
        return product
    return fact_inter(num-1,num * product)

print fact(5)
